import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '项目名称',
    align:"center",
    dataIndex: 'projectName',
     width: 400
   },
  {
    title: '项目状态',
    align:"center",
    dataIndex: 'projectStatus_dictText'
  },
   {
    title: '立项状态',
    align:"center",
    dataIndex: 'setupStatus_dictText'
   },
   {
    title: '项目描述',
    align:"center",
    dataIndex: 'remark'
   },
   {
    title: '总成本',
    align:"center",
    dataIndex: 'totalCost'
   },
/*   {
    title: '成本状态',
    align:"center",
    dataIndex: 'totalCostStatus_dictText'
   },*/
   {
    title: '成本类型',
    align:"center",
    dataIndex: 'costType'
   },
   {
    title: '周期',
    align:"center",
    dataIndex: 'cycle'
   },

   {
    title: '开始时间',
    align:"center",
    dataIndex: 'startTime'
   },
  {
    title: '结束时间',
    align:"center",
    dataIndex: 'endTime'
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '项目名称',
    field: 'projectName',
    component: 'JInput',
    colProps: { span: 4 },
  },
  {
    label: '立项状态',
    field: 'setupStatus',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'setupStatus',
      stringToNumber: true,
    },
    colProps: { span: 4 },
  },
  {
    label: '成本类型',
    field: 'costType',
    component: 'JInput',
    colProps: { span: 4 },
  },
  /*{
    label: '开始时间',
    field: 'startTime',
    component: 'DatePicker',
    componentProps: {
       showTime: false,
       valueFormat: 'YYYY-MM-DD'
    },
    colProps: { span: 4 },
  },
  {
    label: '结束时间',
    field: 'endTime',
    component: 'DatePicker',
    componentProps: {
      showTime: false,
      valueFormat: 'YYYY-MM-DD'
    },
    colProps: { span: 4 },
  },*/
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '项目名称',
    field: 'projectName',
    component: 'Input',
    required: true,
  },
  {
    label: '立项状态',
    field: 'setupStatus',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'setupStatus',
      stringToNumber: true,
      disabled: true
    },
  },

  {
    label: '项目描述',
    field: 'remark',
    component: 'Input',
  },
  {
    label: '总成本',
    field: 'totalCost',
    component: 'InputNumber',
    required: true,
  },
/*  {
    label: '成本状态',
    field: 'totalCostStatus',
    component: 'InputNumber',
  },*/

  {
    label: '成本类型',
    field: 'costType',
    component: 'Input',
  },
  {
    label: '开始时间',
    field: 'startTime',
    component: 'DatePicker',
    required: true,
    componentProps: {
       showTime: false,
       valueFormat: 'YYYY-MM-DD'
     },
  },
  {
    label: '结束时间',
    field: 'endTime',
    component: 'DatePicker',
    required: true,
    componentProps: {
      showTime: false,
      valueFormat: 'YYYY-MM-DD'
    },
  },
  {
    label: '周期',
    field: 'cycle',
    component: 'InputNumber',
    componentProps:{
      disabled: true
    }
  },
  {
    field: 'uploadFile',
    component: 'JUpload',
    helpMessage: '附件上传',
    label: '附件上传',
    componentProps:{
      returnUrl: false
    }
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

//表单数据
export const oopFormSchema: FormSchema[] = [
  {
    label: '项目名称',
    field: 'projectName',
    component: 'Input',
  },
  {
    label: '立项状态',
    field: 'setupStatus',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'setupStatus',
      stringToNumber: true,
    },
  },

  {
    label: '项目描述',
    field: 'remark',
    component: 'Input',
  },
  {
    label: '总成本',
    field: 'totalCost',
    component: 'InputNumber',
  },
/*  {
    label: '成本状态',
    field: 'totalCostStatus',
    component: 'InputNumber',
  },*/

  {
    label: '成本类型',
    field: 'costType',
    component: 'Input',
  },
  {
    label: '周期',
    field: 'cycle',
    component: 'InputNumber',
  },
  {
    label: '开始时间',
    field: 'startTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD'
     },
  },
  {
    label: '结束时间',
    field: 'endTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD'
    },
  },
  {
    field: 'uploadFile',
    component: 'JUpload',
    helpMessage: '附件上传',
    label: '附件上传',
    componentProps:{
      returnUrl: false
    }
  },
	// TODO 主键隐藏字段，目前写死为ID
];


/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
